import { BasicColumn } from '/@/components/Table';
import { h } from 'vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { auths } from '/@/utils/authFunction';

const { t } = useI18n();
/** 基础配置 */
export const basicColumn: BasicColumn[] = [
  {
    title: t('business.commin_vip_level'),
    dataIndex: 'level',
    align: 'center',
    //fixed: 'left',
    minWidth: 150,
    // maxWidth: '20%',
    width: '10%',
    customRender: ({ record }) => {
      return `VIP${record.level}`;
    },
  },
  {
    title: t('table.member.member_people_count'),
    dataIndex: 'total',
    align: 'center',
    minWidth: 150,
    // maxWidth: 150,
    // width: 150,
    width: '10%',
    slots: { customRender: 'memberNumber' },
  },
  {
    title: t('modalForm.member.member_promotion_points'),
    dataIndex: 'upgrade',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    // maxWidth: 250,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: t('modalForm.member.member_relegation_points'),
    dataIndex: 'retain',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    // maxWidth: 250,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: t('table.report.report_bet_multiplier'),
    dataIndex: 'multiple',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    // maxWidth: 250,
    // width: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: t('table.member.member_defalut_level'),
    minWidth: 150,
    // maxWidth: 100,
    // width: 150,
    align: 'center',
    width: '10%',
    dataIndex: 'is_default',
    customRender: ({ record }) => {
      const text = record.is_default === 1 ? '是' : '否';
      const color = record.is_default === 1 ? '#1CD91C' : '';
      return h('div', { style: { color: color } }, text);
    },
  },
  {
    title: t('business.common_operate'), //操作
    minWidth: '60px',
    // maxWidth: 100,
    // width: 150,
    width: '5%',
    dataIndex: '',
    slots: { customRender: 'action', style: { textAlign: 'center' } },
    ifShow: auths(['10513', '10512', '10514']),
  },
];

/** 晋级奖金 */
export const upgradeColumn: BasicColumn[] = [
  {
    title: t('business.commin_vip_level'),
    dataIndex: 'level',
    align: 'center',
    // fixed: 'left',
    minWidth: 150,
    width: '10%',
    customRender: ({ record }) => {
      return `VIP${record.level}`;
    },
  },
  {
    title: `${t('table.member.member_promotion_gift')}(USDT)`,
    dataIndex: 'usdt',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_promotion_gift')}(BRL)`,
    dataIndex: 'brl',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_promotion_gift')}(CNY)`,
    dataIndex: 'cny',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_promotion_gift')}(THB)`,
    dataIndex: 'thb',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_promotion_gift')}(KVND)`,
    dataIndex: 'kvnd',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_promotion_gift')}(INR)`,
    dataIndex: 'inr',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
];

/** 月奖金 */
export const monthColumn: BasicColumn[] = [
  {
    title: t('business.commin_vip_level'),
    dataIndex: 'level',
    align: 'center',
    // fixed: 'left',
    minWidth: 150,
    width: '10%',
    customRender: ({ record }) => {
      return `VIP${record.level}`;
    },
  },
  {
    title: `${t('table.member.member_every_month')}(USDT)`,
    dataIndex: 'usdt',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_month')}(BRL)`,
    dataIndex: 'brl',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_month')}(CNY)`,
    dataIndex: 'cny',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_month')}(THB)`,
    dataIndex: 'thb',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_month')}(KVND)`,
    dataIndex: 'kvnd',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_month')}(INR)`,
    dataIndex: 'inr',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
];

/** 周奖金 */
export const weekColumn: BasicColumn[] = [
  {
    title: t('business.commin_vip_level'),
    dataIndex: 'level',
    align: 'center',
    // fixed: 'left',
    minWidth: 150,
    width: '10%',
    customRender: ({ record }) => {
      return `VIP${record.level}`;
    },
  },
  {
    title: `${t('table.member.member_every_week')}(USDT)`,
    dataIndex: 'usdt',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_week')}(BRL)`,
    dataIndex: 'brl',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_week')}(CNY)`,
    dataIndex: 'cny',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_week')}(THB)`,
    dataIndex: 'thb',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_week')}(KVND)`,
    dataIndex: 'kvnd',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_week')}(INR)`,
    dataIndex: 'inr',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 150,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
];

/** 日奖金 */
export const dayColumn: BasicColumn[] = [
  {
    title: t('business.commin_vip_level'),
    dataIndex: 'level',
    align: 'center',
    // fixed: 'left',
    minWidth: 150,
    width: '10%',
    customRender: ({ record }) => {
      return `VIP${record.level}`;
    },
  },
  {
    title: `${t('table.member.member_every_day')}(USDT)`,
    dataIndex: 'usdt',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 200,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_day')}(BRL)`,
    dataIndex: 'brl',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    minWidth: 200,
    width: '10%',
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_day')}(CNY)`,
    dataIndex: 'cny',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    width: 200,
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_day')}(THB)`,
    dataIndex: 'thb',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    width: 200,
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_day')}(KVND)`,
    dataIndex: 'kvnd',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    width: 200,
    editComponentProps: {
      min: 0,
    },
  },
  {
    title: `${t('table.member.member_every_day')}(INR)`,
    dataIndex: 'inr',
    align: 'center',
    editRow: true,
    editComponent: 'InputNumber',
    width: 200,
    editComponentProps: {
      min: 0,
    },
  },
];
